#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<ctype.h>

int lengthOfLastWord(char* s)
{
    int tail = -1;
    int head = -1;

    for (int i = 0; s[i] != '\0'; i++)
    {
        if (!isspace(s[i]))
            tail = i;
    }
    for (int i = tail; i >= 0; i--)
    {
        if (isspace(s[i]))
        {
            head = i;
            break;
        }
    }
    return (tail - head);
}

int main()
{

	return 0;
}